package com.fenghongzhang.day012;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

/**
 * 动态 - 静态
 * //,注册的意思,就是加一个频道
 */
public class MyReceiver extends BroadcastReceiver {

    private static final String TAG = "MyReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i(TAG, "onReceive: 11111");

        String action = intent.getAction();
        if(action.equals("com.feng")){
            String name = intent.getStringExtra("name");
            Log.i(TAG, "onReceive: "+name);
        }else if(action.equals("com.feng1")){
            Bundle extras = intent.getExtras();
            String name1 = extras.getString("name1");
            Log.i(TAG, "onReceive: "+name1);
        }

    }
}
